<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/



// Route::get('/', function () {
//     return view('welcome');
// });




// //404
// Route::get('404',function(){
// 	abort(404);
// });


// 创建路由组
Route::group(['middleware'=>'login'],function(){

	// 隐式路由 后台控制器
	Route::Controller('/admin/index','AdminController');


	// 后台用户的管理路由
	Route::Controller('/admin/user','UserController');

	//分类管理路由
	Route::Controller('/admin/cate','CateController');
	// 商品管理路由
	Route::Controller('/admin/good','GoodController');

	// 订单管理路由
	Route::Controller('/admin/order','OrderController');
	// 轮播图管理路由
	Route::Controller('/admin/carousel','CarouselController');

	//公告管理路由
	Route::Controller('/admin/gonggao','GonggaoController');
	// 后台链接管理
	Route::Controller('/admin/link','LinkController');

});

// 后台登录
// Route::get('/admin/log','LoginController@login');
Route::Controller('/admin/log','LoginController');
Route::get('/admin/logout','LoginController@logout');




//注册

Route::Controller('register','RegisterController');

// Route::get('register','RegisterController@vcode');

Route::post('register','RegisterController@doregister');



//邮件测试
Route::get('mail','RegisterController@sendMail');

//激活
Route::get('jihuo','RegisterController@jihuo');

//前台登录
Route::get('logins','LoginsController@getLogins');
Route::post('logins','LoginsController@postChecks');

//退出登录
Route::get('logout','LoginsController@getLogout');

//网站前台首页路由
Route::get('/','IndexController@index');

// 评价路由

Route::Controller('evaluate','EvaluateController');
Route::get('eval','EvaluateController@getEval');
//忘记密码
Route::get('forget','LoginsController@getForget');
Route::post('forget','LoginsController@doforget');


//重置密码
Route::get('reset','LoginsController@reset');
Route::post('reset','LoginsController@doReset');

//商品列表
Route::get('/search','LiebiaoController@search');
Route::get('/liebiao/{id}','LiebiaoController@index');
//商品详情
Route::get('/goods/{id}','GoodController@show');

//加入购物车
Route::post('/shopcar/insert','CarController@insert');
//查看购物车
Route::get('/shopcar/index','CarController@index');
// 清空购物车
Route::get('/shopcar/clear','CarController@clear');
//购物车删除操作
Route::match(['post','get'],'/shopcar/delete','CarController@delete');
//下单操作
Route::match(['post','get'],'/order/insert','OrdersController@insert');
//创建订单
Route::post('/order/create','OrdersController@create');

//地址添加
Route::post('/address/insert','AddressController@insert');

//地址列表
Route::get('/address/addlist','AddressController@addlist');
//地址删除
Route::get('/address/delete','AddressController@delete');
//地址修改
Route::get('/address/edit/{id}','AddressController@edit');
Route::post('/address/update','AddressController@update');


//订单提交成功
Route::get('order/finish','OrdersController@finish');


//忘记密码
Route::get('forget','LoginsController@getForget');
Route::post('forget','LoginsController@doforget');


//重置密码
Route::get('reset','LoginsController@reset');
Route::post('reset','LoginsController@doReset');

//个人中心
Route::get('geren','CollectController@getGeren');

//网站收藏
Route::get('collect','CollectController@getCollect');
Route::get('sc','CollectController@getSc');
Route::get('del','CollectController@delCollect');


//个人设置
Route::get('set','SetController@getSet');

//个人资料修改
Route::Controller('gerens','SetController');
//密码修改
Route::get('xiugai','SetController@getXiugai');
Route::post('update','SetController@postUpdate');



// 前台订单
// Route::Controller('/admin/carousel','CarouselController');
Route::Controller('geren','DingdanController');
Route::get('/orders/delete','DingdanController@delete');



